#include<iostream>
#include<string>

int main()
{
    std::string s;
    std::cin >> s;
    s += "world";
    std::string s2 = s + ",jack";
    std::cout << (s2==s) << std::endl;

    return 0;
}